#ifndef __GS_BUFFER_H__
#define __GS_BUFFER_H__

#include <stdlib.h>
#include <string.h>

typedef struct Buffer {
  int capacity;
  int offset;
  int length;
  char* data;
} Buffer;

Buffer* BufferCreate(int capacity);
Buffer* BufferCreate2(const char* cmd, int length);
void BufferDestroy(void* b);
Buffer* BufferResize(Buffer* b, int capacity);
int BufferCanContains(Buffer* b, int length);
Buffer* BufferShift(Buffer* b);
Buffer* BufferExpand(Buffer* b, int capacity);
Buffer* BufferAppend(Buffer* b, const char* data, int length);
Buffer* BufferReset(Buffer* b); 
Buffer* BufferClear(Buffer* b);
int BufferIsFull(Buffer* b);

#endif
